import { v4 as uuidv4 } from 'uuid'
// 生成一个随机字符串
export const getUUID = () => {
    // 如果本地有先从本地存储获取uuid
    let uuid_token = localStorage.getItem('UUIDTOKEN');;
    if (!uuid_token) {
        // 生成游客临时身份
        uuid_token = uuidv4();
        // 存储子啊本地
        localStorage.setItem('UUIDTOKEN', uuid_token);
    }
    return uuid_token;
}